using System;
using System.Windows.Forms;
using System.Drawing;

namespace WinformToolkit.Drawing
{
    /// <summary>
    /// Ellipse graphic object
    /// </summary>
    public class DrawEllipse : WinformToolkit.Drawing.DrawRectangle
    {
        public override DrawArea.DrawToolType Type => DrawArea.DrawToolType.Ellipse;

        public DrawEllipse(PropertiesGraphics properties) : 
            base(properties)
        {
            Initialize();
        }

        /// <summary>
        /// Clone this instance
        /// </summary>
        public override DrawObject Clone()
        {
            DrawEllipse drawEllipse = new DrawEllipse(null);

            FillDrawObjectFields(drawEllipse);
            return drawEllipse;
        }


        public override void Draw(DrawingContext dc)
        {
            Graphics g = dc.Graphics;

            Pen pen = new Pen(Color, PenWidth);

            g.DrawEllipse(pen, DrawRectangle.GetNormalizedRectangle(this.rectangle));

            pen.Dispose();
        }


    }
}
